﻿using System;
using ComDevFx.Arch.Base;
using ComDevFx.Arch.Base.Persister.NH.Burrow;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Apodidae.Test
{
    [TestClass]
    public class BootStrapTestCaseBase
    {
        private static readonly BurrowFramework bf = new BurrowFramework();

        [TestInitialize]
        public void MyTestInitialize()
        {
            bf.InitWorkSpace();
        }

        [TestCleanup]
        public void MyTestCleanup()
        {
            bf.CloseWorkSpace();
        }

        public void ResetWorkSpace()
        {
            bf.CloseWorkSpace();
            bf.BurrowEnvironment.ShutDown(); //Restart the environment to prepare a fresh start 
            bf.BurrowEnvironment.Start();
            bf.InitWorkSpace();
        }
    }

    [TestClass]
    public class BootStrapTestCaseBaseGlobal
    {
        [AssemblyInitialize]
        public static void Setup(TestContext context)
        {
            FxArchBootstrapper.Init();
        }


        [AssemblyCleanup]
        public static void Dispose()
        {
            FxArchBootstrapper.Stop();
        }
    }
}
